﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DatabaseAccessLayer;

namespace WebApplication.administrator
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void btnSignIn_Click(object sender, EventArgs e)
        {
            string UserName = txtUserName.Text.Trim();
            string Password = txtPassword.Text;
            DatabaseAccessLayer.Admin admin = AdminLogin.AdminLogOn(UserName, Password);
            if (null != admin)
            {
                Session["Admin"] = admin.Name;
                Session["AdminID"] = admin.ID;
                Response.Redirect("ManageUsers.aspx?Member=false");
            }
            Response.Redirect("ManageUsers.aspx?Member=false");
        }
    }
}